﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NetDh.Lib
{
    public class UserToken
    {
        /// <summary>
        /// 用户Id。为null时，说明当前实例是空实例。
        /// </summary>
        public string UserId { get; set; }

        public string UserName { get; set; }
        public string UserType { get; set; }
        public string Platform { get; set; }
        /// <summary>
        /// 创建token的时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// http请求时的时间，每次http请求都会创建一个UserToken实例。临时记录请求时间，用于慢日志处理。
        /// </summary>
        public DateTime _HttpTime;
        public UserToken()
        {
            CreateTime = DateTime.Now;
        }
        public static UserToken CreateEmptyInstance()
        {
            return new UserToken() { UserId = null, CreateTime = default(DateTime) };
        }
    }
}
